package com.nanyang.tms.api.dto.request.companyadjustment;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nanyang.common.core.domain.ApiRequest;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class CompanyAdjustmentAddRequest extends ApiRequest {

    @JsonIgnore
    private String pin;

    /**
     * 客户代码
     */
    @NotEmpty(message = "客户编码不能为空")
    @Length(max = 32, message = "companyCode长度需小于32个字符")
    private String companyCode;


    /**
     * 调账类型（0增加1减少）
     */
    @NotNull(message = "调账类型不能为空")
    private Integer adjustmentType;

    /**
     * 调账金额
     */
    @NotNull(message = "调账金额不能为空")
    @Digits(integer = 9, fraction=2, message = "amount格式不正确")
    @DecimalMin(value = "0.00", message = "amount格式不正确")
    private BigDecimal amount;

    /**
     * 备注
     */
    @Length(max = 200, message = "remark长度需小于200个字符")
    private String remark;

    @Override
    public void requestCheck() {

    }
}
